using System.Data;
using VanTaiProperty;
namespace VanTaiData
{
    public class clsTMReligionController
    {
        private clsConnect cls = new clsConnect();

        #region Getdata
        public DataTable BindGirdTMReligion(string keywords)
        {
            return cls.Search("sp_TMReligion", "@KeyWords", keywords);
        }
        public DataTable BindGirdTMReligionDetail(int id)
        {
            return cls.LayDuLieuParameter("sp_TMReligion_Detail", "@Religion_ID", id);
        }
        #endregion

        #region Insert
        public bool InsertTMReligion(clsTMReligionProperty data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Religion_Alias", data.Religion_Alias);
            cls.AddParameter("@Religion_Name", data.Religion_Name);
            cls.AddParameter("@Religion_Note", data.Religion_Note);
            cls.AddParameter("@Religion_MaCha", data.Religion_MaCha);
            cls.AddParameter("@Religion_NameE", data.Religion_NameE);
            cls.AddParameter("@Religion_NameC", data.Religion_NameC);
            cls.ExecuteNonQuery("sp_TMReligion_Insert");
            return true;
        }
        #endregion

        #region Update
        public bool UpdateTMReligion(clsTMReligionProperty data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Religion_ID", data.Religion_ID);
            cls.AddParameter("@Religion_Alias", data.Religion_Alias);
            cls.AddParameter("@Religion_Name", data.Religion_Name);
            cls.AddParameter("@Religion_Note", data.Religion_Note);
            cls.AddParameter("@Religion_MaCha", data.Religion_MaCha);
            cls.AddParameter("@Religion_NameE", data.Religion_NameE);
            cls.AddParameter("@Religion_NameC", data.Religion_NameC);
            cls.ExecuteNonQuery("sp_TMReligion_Update");
            return true;
        }
        #endregion

        #region Delete
        public bool DeleteTMReligion(int id)
        {
            cls.Delete("sp_TMReligion_Delete", "@Religion_ID", id);
            return true;
        }
        #endregion
    }
}